package com.ocom.common.entity.human;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.ocom.common.entity.base.EntityBase;
import com.ocom.common.entity.typehandler.PersonInfoHandle;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(value = "personnel_info",autoResultMap = true)
public class EntityPersonnelInfo extends EntityBase implements Serializable {
  
    private static final long serialVersionUID = -652785128175895379L;
    @TableId(value = "p_id", type = IdType.AUTO)
    @JsonProperty("pId")
    private Long pId;
    private Long comId;
    private Long deptId;
    @JsonProperty("pCode")
    private String pCode;
    @JsonProperty("pName")
    private String pName;

    @TableField(typeHandler = PersonInfoHandle.class)
    @JsonProperty("pPwd")
    private String pPwd;
    @JsonProperty("pSex")
    private Integer pSex;
    @JsonProperty("pType")
    private Long pType;

    @TableField(typeHandler = PersonInfoHandle.class)
    @JsonProperty("pPhone")
    private String pPhone;

    @TableField(typeHandler = PersonInfoHandle.class)
    @JsonProperty("pIdentity")
    private String pIdentity;

    @JsonProperty("ykmStr")
    private String ykmStr;
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+08")
    @JsonProperty("pBorn")
    private Date pBorn;
    @JsonProperty("pAddress")
    private String pAddress;
    @JsonProperty("pPhotoUrl")
    private String pPhotoUrl;

    @JsonProperty("pPhotoUrl2")
    private String pPhotoUrl2;

    @JsonProperty("status")
    private Integer status;

    @JsonProperty("encryIdentity")
    private String encryIdentity;

    @JsonProperty("encryPhone")
    private String encryPhone;

    @JsonProperty("regionId")
    private Long regionId;
    @JsonProperty("regionOrigId")
    private Long regionOrigId;

    @JsonProperty("regionOnline")
    private Long regionOnline;

    String pTags;

    //卡号
    @TableField(exist = false)
    @JsonProperty("cardNo")
    private String cardNo = "" ;

    //消费帐号
    @TableField(exist = false)
    @JsonProperty("accountNo")
    private String accountNo = "" ;

    //消费帐号
    @TableField(exist = false)
    @JsonProperty("cardState")
    private Integer cardState = 2 ;

    //账户类型id
    @TableField(exist = false)
    @JsonProperty("accTypeId")
    private Integer accTypeId;

    //标签列表
    @TableField(exist = false)
    @JsonProperty("perTags")
    private List<EntityPersonTag> perTags;

    @TableField(exist = false)
    private Date endDate;

    //银行卡号
    @JsonProperty("bankNo")
    @TableField(typeHandler = PersonInfoHandle.class)
    private String bankNo;

    //账户有效期；
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+08")
    @JsonProperty("accountEndDate")
    @TableField(exist = false)
    private Date accountEndDate;


    @Override
    public String toString() {
        return "EntityPersonnelInfo{" +
                "pId=" + pId +
                ", comId=" + comId +
                ", deptId=" + deptId +
                ", pCode='" + pCode + '\'' +
                ", pName='" + pName + '\'' +
                ", pPwd='" + pPwd + '\'' +
                ", pSex=" + pSex +
                ", pType=" + pType +
                ", pPhone='" + pPhone + '\'' +
                ", pIdentity='" + pIdentity + '\'' +
                ", ykmStr='" + ykmStr + '\'' +
                ", pBorn=" + pBorn +
                ", pAddress='" + pAddress + '\'' +
                ", pPhotoUrl='" + pPhotoUrl + '\'' +
                ", pPhotoUrl2='" + pPhotoUrl2 + '\'' +
                ", status=" + status +
                ", encryIdentity='" + encryIdentity + '\'' +
                ", encryPhone='" + encryPhone + '\'' +
                ", regionId=" + regionId +
                ", regionOrigId=" + regionOrigId +
                ", regionOnline=" + regionOnline +
                ", pTags='" + pTags + '\'' +
                ", cardNo='" + cardNo + '\'' +
                ", accountNo='" + accountNo + '\'' +
                ", cardState=" + cardState +
                ", bankNo=" + bankNo +
                '}';
    }
}
